#pragma  once

#ifndef __SDK_INTERFACE_H_
#define __SDK_INTERFACE_H_

#include "cmd_def.h"

typedef int (__stdcall *GetRecordCallback_T)(int32_t serviceHandle, uint32_t sid, uint8_t result, const RecordFileInfo * files, unsigned fileCount, void *pUser);
typedef int (__stdcall *GetEventCallback_T)(int32_t serviceHandle, uint8_t msgType, uint32_t sid, uint8_t result,  void *pUser);
typedef int (__stdcall *GetStreamCallback_T)(int32_t serviceHandle, uint8_t msgType, uint32_t sid, uint8_t *nal_buf, uint32_t nal_len, void *pUser);

extern "C" int32_t PASCAL NET_NVR_Init();
extern "C" int32_t PASCAL NET_NVR_RegisterCallback(GetEventCallback_T pEventCallback, GetStreamCallback_T pStreamCallback, GetRecordCallback_T pRecordListCallback,  void *pUserData);
extern "C" int32_t PASCAL NET_NVR_OpenService(const  char *ip1, const char * ip2);
extern "C" int32_t PASCAL NET_NVR_QueryRecord(int32_t serviceHandle, uint32_t sid, uint16_t channelNo, int64_t begintime, int64_t endtime);
extern "C" int32_t PASCAL NET_NVR_PlayLiveStreaming(int32_t serviceHandle, uint32_t sid, uint16_t channelNo);
extern "C" int32_t PASCAL NET_NVR_PlaybackRecord(int32_t serviceHandle, uint32_t sid, uint16_t channelNo, int64_t begintime, int64_t endtime);
extern "C" int32_t PASCAL NET_NVR_StopPlay(int32_t serviceHandle, uint32_t sid);
extern "C" int32_t PASCAL NET_NVR_CloseService(int32_t serviceHandle);
extern "C" uint32_t  PASCAL NET_NVR_GenSessionId();
extern "C" void    PASCAL NET_NVR_Cleanup();

#endif